<?php


namespace Yeepay\Yop\Sdk\Service\AgencyOperation;


use Yeepay\Yop\Sdk\Client\ClientExecutionParams;
use Yeepay\Yop\Sdk\Client\ClientHandler;
use Yeepay\Yop\Sdk\Client\ClientParams;
use Yeepay\Yop\Sdk\Exception\YopClientException;
use Yeepay\Yop\Sdk\Service\AgencyOperation\Model as Model;

class AgencyOperationClient
{
    /**
     * @var ClientHandler
     */
    private $clientHandler;

    /**
     * AgencyOperationClient constructor.
     * @param ClientParams $clientParams
     */
    function __construct(ClientParams $clientParams)
    {
        $this->clientHandler = new ClientHandler($clientParams);
    }

    /**
     * @param Model\ShopBindRequest $request
     * @return Model\ShopBindResponse
     * @throws YopClientException
     */
    public function shopBind(Model\ShopBindRequest $request)
    {
        if ($request == null) {
            throw new YopClientException("request is required.");
        }
        $clientExecutionParams = new ClientExecutionParams($request, Model\ShopBindRequestMarshaller::getInstance(),
            Model\ShopBindResponseUnMarshaller::getInstance());
        return $this->clientHandler->execute($clientExecutionParams);
    }
    /**
     * @param Model\ShopBindQueryRequest $request
     * @return Model\ShopBindQueryResponse
     * @throws YopClientException
     */
    public function shopBindQuery(Model\ShopBindQueryRequest $request)
    {
        if ($request == null) {
            throw new YopClientException("request is required.");
        }
        $clientExecutionParams = new ClientExecutionParams($request, Model\ShopBindQueryRequestMarshaller::getInstance(),
            Model\ShopBindQueryResponseUnMarshaller::getInstance());
        return $this->clientHandler->execute($clientExecutionParams);
    }
    /**
     * @param Model\WithholdRequest $request
     * @return Model\WithholdResponse
     * @throws YopClientException
     */
    public function withhold(Model\WithholdRequest $request)
    {
        if ($request == null) {
            throw new YopClientException("request is required.");
        }
        $clientExecutionParams = new ClientExecutionParams($request, Model\WithholdRequestMarshaller::getInstance(),
            Model\WithholdResponseUnMarshaller::getInstance());
        return $this->clientHandler->execute($clientExecutionParams);
    }
    /**
     * @param Model\WithholdQueryRequest $request
     * @return Model\WithholdQueryResponse
     * @throws YopClientException
     */
    public function withholdQuery(Model\WithholdQueryRequest $request)
    {
        if ($request == null) {
            throw new YopClientException("request is required.");
        }
        $clientExecutionParams = new ClientExecutionParams($request, Model\WithholdQueryRequestMarshaller::getInstance(),
            Model\WithholdQueryResponseUnMarshaller::getInstance());
        return $this->clientHandler->execute($clientExecutionParams);
    }
    /**
     * @param Model\WithholdRecordQueryV10Request $request
     * @return Model\WithholdRecordQueryV10Response
     * @throws YopClientException
     */
    public function withhold_record_query_v1_0(Model\WithholdRecordQueryV10Request $request)
    {
        if ($request == null) {
            throw new YopClientException("request is required.");
        }
        $clientExecutionParams = new ClientExecutionParams($request, Model\WithholdRecordQueryV10RequestMarshaller::getInstance(),
            Model\WithholdRecordQueryV10ResponseUnMarshaller::getInstance());
        return $this->clientHandler->execute($clientExecutionParams);
    }
    /**
     * @param Model\WithholdShopBindQueryV10Request $request
     * @return Model\WithholdShopBindQueryV10Response
     * @throws YopClientException
     */
    public function withhold_shop_bind_query_v1_0(Model\WithholdShopBindQueryV10Request $request)
    {
        if ($request == null) {
            throw new YopClientException("request is required.");
        }
        $clientExecutionParams = new ClientExecutionParams($request, Model\WithholdShopBindQueryV10RequestMarshaller::getInstance(),
            Model\WithholdShopBindQueryV10ResponseUnMarshaller::getInstance());
        return $this->clientHandler->execute($clientExecutionParams);
    }
    /**
     * @param Model\WithholdShopBindV10Request $request
     * @return Model\WithholdShopBindV10Response
     * @throws YopClientException
     */
    public function withhold_shop_bind_v1_0(Model\WithholdShopBindV10Request $request)
    {
        if ($request == null) {
            throw new YopClientException("request is required.");
        }
        $clientExecutionParams = new ClientExecutionParams($request, Model\WithholdShopBindV10RequestMarshaller::getInstance(),
            Model\WithholdShopBindV10ResponseUnMarshaller::getInstance());
        return $this->clientHandler->execute($clientExecutionParams);
    }
    /**
     * @param Model\WithholdV10Request $request
     * @return Model\WithholdV10Response
     * @throws YopClientException
     */
    public function withhold_v1_0(Model\WithholdV10Request $request)
    {
        if ($request == null) {
            throw new YopClientException("request is required.");
        }
        $clientExecutionParams = new ClientExecutionParams($request, Model\WithholdV10RequestMarshaller::getInstance(),
            Model\WithholdV10ResponseUnMarshaller::getInstance());
        return $this->clientHandler->execute($clientExecutionParams);
    }
}
